﻿using System.Resources;

namespace  Source.Web.FrameWork
{
    public interface ITextRepositoryManager
    {
        string TryGetValue(string key);
    }

    public class TextRepositoryManager : ITextRepositoryManager
    {

        private ResourceManager _resourceManager;

        public TextRepositoryManager()
        {
            _resourceManager = new ResourceManager(" Source.Web.App_GlobalResources.TextRepository", GetType().Assembly);
        }

        public string TryGetValue(string key)
        {
            string value = _resourceManager.GetString(key);
            return value ?? key;
        }

    }
}
